package com.design.genernal;

public class ConcreteColleagueA extends Colleague {

    public ConcreteColleagueA(Mediator mediator) {
        super(mediator);
        this.mediator.setColleageA(this);
    }


    // 自有方法：selftMethodB
    public void selftMethodA() {
        // 处理自己的逻辑
        System.out.println(String.format("%s:selft-Mehod", this.getClass().getSimpleName()));

    }


    public void depMethodA() {
        // 处理自己的逻辑
        System.out.println(String.format("%sdepMethod:delegate to Mediator", this.getClass().getSimpleName()));
        // 无法处理的业务逻辑委托给中介者处理
        this.mediator.transferB();
    }
}
